﻿<phone:PhoneApplicationPage
    x:Class="TakePhotoTogether.View.CropPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel">
            <ViewportControl x:Name="Viewport" SizeChanged="Viewport_SizeChanged"
                   ManipulationStarted="Viewport_ManipulationStarted"
                   ManipulationDelta="Viewport_ManipulationDelta"
                   ManipulationCompleted="Viewport_ManipulationCompleted"
                   ManipulationStateChanged="Viewport_ManipulationStateChanged">
                <Image x:Name="Image" Stretch="Uniform" CacheMode="BitmapCache"/>
            </ViewportControl>

            <Grid IsHitTestVisible="False">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Rectangle Grid.Row="0" Grid.ColumnSpan="3" Fill="Black" Opacity="0.5"/>
                <Rectangle Grid.Row="1" Grid.Column="0" Fill="Black" Opacity="0.5"/>
                <Rectangle Grid.Row="1" Grid.Column="2" Fill="Black" Opacity="0.5"/>
                <Rectangle Grid.Row="2" Grid.ColumnSpan="3" Fill="Black" Opacity="0.5"/>

                <Border x:Name="Crop" Grid.Row="1" Grid.Column="1" Width="440" Height="440"
                        BorderBrush="White" BorderThickness="2"/>
            </Grid>
        </Grid>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar >
        <shell:ApplicationBar ForegroundColor="#FFFFFFFF"
                              BackgroundColor="#FF000000"/>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>